/**
 * Copyright (c) 2009 Netflix-Flex_API Contributors.
 * 
 * Permission is hereby granted, free of charge, to any person obtaining a copy of 
 * this software and associated documentation files (the "Software"), to deal in 
 * the Software without restriction, including without limitation the rights to 
 * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 
 * of the Software, and to permit persons to whom the Software is furnished to do 
 * so, subject to the following conditions:
 * 
 * The above copyright notice and this permission notice shall be included in all 
 * copies or substantial portions of the Software.
 * 
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE. 
 * */
package com.netflix.webapis.catalog.params
{
	import com.netflix.webapis.ParamsBase;
	
	/**
	 * Parameters to the Catalog Services.
	 * @author jonbcampos
	 * 
	 */	
	public class CatalogParams extends ParamsBase
	{
		public function CatalogParams()
		{
		}
		
		
		private var _includeAmg:Boolean = false;
		private var _includeTms:Boolean = false;
		
		/**
		 * @inherit
		 */		
		override public function toString():String
		{
			var resultList:Array = new Array();
			
			if(term && term!="") resultList.push("&term=" + escape(term));
			if(startIndex) resultList.push("&start_index=" + escape(startIndex.toString()));
			if(maxResults) resultList.push("&max_results=" + escape(maxResults.toString()));
			if(expand) resultList.push("&expand=" + escape(expand));
			
			var returnString:String = "";
			for(var i:int=0;i<resultList.length;i++)
			{
				var item:String = resultList[i];
				returnString += item;
			}
			return returnString;
		}
		/**
		 * @inherit
		 */		
		override public function toObject():Object
		{
			var o:Object = new Object();
			if(term) o["term"] = escape(term);
			if(startIndex) o["start_index"] = escape(startIndex.toString());
			if(maxResults) o["max_results"] = escape(maxResults.toString());
			if(expand) o["expand"] = expand;
			return o;
		}
		
		/**
		 * Term Parameters purpose changes dependent on the service being called.
		 * 
		 * <p>
		 * <ul>
		 * <li>Catalog Service: The word or term for which to search in the catalog. 
		 * The method searches the title and synopses of catalog titles fields for a 
		 * match.</li>
		 * </ul>
		 * </p>
		 */		
		public var term:String = "";
		
		[Inspectable(defaultValue="movie",enumeration="index,autoComplete,catalog,movie,series,season,program,disc",category="General")]
		/**
		 * Type of service. 
		 */		
		public var type:String = "movie";
		
		
		//---------------------------
		// expand
		//---------------------------
		/**
		 * Parameter that will expand sections of the response to prevent the need for n additional calls 
		 * Multiple selections can be specified by using a comma delimiter
		 */		
		public var expand:String;
		/**
		 * Flag to get just the expansion list rather than the entire item. 
		 */		
		public var retrieveExpansionOnly:Boolean = false;
		
		//---------------------------
		// movieID
		//---------------------------
		/**
		 * The ID for the object being looked up, could be a movie, series, etc. ID 
		 */
		public var movieID:String;
		
		//---------------------------
		// seriesID
		//---------------------------
		/**
		 * The ID for the object being looked up, could be a movie, series, etc. ID 
		 */
		public var seriesID:String;
		
		//---------------------------
		// seasonID
		//---------------------------
		/**
		 * The ID for the object being looked up, could be a movie, series, etc. ID 
		 */
		public var seasonID:String;
		
		//---------------------------
		// episodeID
		//---------------------------
		/**
		 * The ID for the object being looked up, could be a movie, series, etc. ID 
		 */
		public var episodeID:String;
		
		//---------------------------
		// personID
		//---------------------------
		/**
		 * The ID for the object being looked up, could be a movie, series, etc. ID 
		 */
		public var personID:String
		
		//---------------------------
		// discID
		//---------------------------
		/**
		 * The ID for the object being looked up, could be a movie, series, etc. ID 
		 */
		public var discID:String;
		
		//---------------------------
		// discID
		//---------------------------
		/**
		 * The ID for the object being looked up, could be a movie, series, etc. ID 
		 */
		public var programID:String;
		
		
	}
}